

<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>WIN10+TF2.0 - cxp&#39;s blog</title>
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  <meta name="google" content="notranslate" />

  
  
  <meta name="description" content=" WIN10+TF2.0+CUDA10.0+cuDNN..."> 
  
  <meta name="author" content="Alex"> 

  
    <link rel="icon" href="/images/icons/favicon-16x16.png" type="image/png" sizes="16x16">
  
  
    <link rel="icon" href="/images/icons/favicon-32x32.png" type="image/png" sizes="32x32">
  
  
    <link rel="apple-touch-icon" href="/images/icons/apple-touch-icon.png" sizes="180x180">
  
  
    <meta rel="mask-icon" href="/images/icons/stun-logo.svg" color="#333333">
  
  
    <meta rel="msapplication-TileImage" content="/images/icons/favicon-144x144.png">
    <meta rel="msapplication-TileColor" content="#000000">
  

  <link rel="stylesheet" href="/css/style.css">

  
  <link rel="stylesheet" href="//at.alicdn.com/t/font_1445822_h1619vhl1nr.css">
  

  
  
  <link rel="stylesheet" href="https://cdn.bootcss.com/fancybox/3.5.7/jquery.fancybox.min.css">
  

  
  
  <link rel="stylesheet" href="https://cdn.bootcss.com/highlight.js/9.18.1/styles/xcode.min.css">
  

  <script>
    var CONFIG = window.CONFIG || {};
    var ZHAOO = window.ZHAOO || {};
    CONFIG = {
      isHome: false,
      fancybox: true,
      pjax: false,
      lazyload: {
        enable: true,
        loadingImage: '',
      },
      donate: {
        enable: true,
        alipay: 'https://pic.izhaoo.com/alipay.jpg',
        wechat: 'https://pic.izhaoo.com/wechat.jpg'
      },
      motto: {
        api: '',
        default: '我在开了灯的床头下，想问问自己的心啊。'
      },
      galleries: {
        enable: true
      },
      fab: {
        enable: true,
        alwaysShow: false
      },
      carrier: {
        enable: true
      },
      daovoice: {
        enable: true
      }
    }
  </script>

  

  
<link rel="alternate" href="/atom.xml" title="cxp's blog" type="application/atom+xml">
</head>
<body class="lock-screen">
  <div class="loading"></div>
  


<nav class="navbar">
  <div class="left"></div>
  <div class="center">WIN10+TF2.0</div>
  <div class="right">
    <i class="iconfont iconmenu j-navbar-menu"></i>
  </div>
</nav>

  <nav class="menu">
  <div class="menu-wrap">
    <div class="menu-close">
      <i class="iconfont iconbaseline-close-px"></i>
    </div>
    <ul class="menu-content">
      
      
      
      
      <li class="menu-item"><a href="/ " class="underline"> 首页</a></li>
      
      
      
      
      <li class="menu-item"><a href="/galleries " class="underline"> 摄影</a></li>
      
      
      
      
      <li class="menu-item"><a href="/archives " class="underline"> 归档</a></li>
      
      
      
      
      <li class="menu-item"><a href="/tags " class="underline"> 标签</a></li>
      
      
      
      
      <li class="menu-item"><a href="/categories " class="underline"> 分类</a></li>
      
      
      
      
      <li class="menu-item"><a href="/about " class="underline"> 关于</a></li>
      
    </ul>
    <div class="menu-copyright"><p>Powered by <a target="_blank" href="https://hexo.io">Hexo</a>  |  Theme - <a target="_blank" href="https://github.com/izhaoo/hexo-theme-zhaoo">zhaoo</a></p></div>
  </div>
</nav>
  <main id="main">
  <div class="container" id="container">
    <article class="article">
  <div class="wrap">
    <section class="head">
  <img   class="lazyload" data-original="/images/theme/post-image.jpg" src=""  draggable="false">
  <div class="head-mask">
    <h1 class="head-title">WIN10+TF2.0</h1>
    <div class="head-info">
      <span class="post-info-item"><i class="iconfont iconcalendar"></i>十二月 03, 2019</span
        class="post-info-item">
      
      <span class="post-info-item"><i class="iconfont iconfont-size"></i>2456</span>
    </div>
  </div>
</section>
    <section class="main">
      <section class="content">
        <h1 id="win10tf20cuda100cudnn75opencv412"><a class="markdownIt-Anchor" href="#win10tf20cuda100cudnn75opencv412"></a> WIN10+TF2.0+CUDA10.0+cuDNN7.5+OpenCV4.1.2</h1>
<blockquote>
<p>配置gpu版本的tensorflow完全是小白入门tensorflow的第一步；我的电脑gpu太差也就是仅仅学习下MX250</p>
<p>参考了一些详细的教程，但是对于安装的版本来说有些指定的不太明确，这有个建议就是不要一味的追求新，要注意查找版本之间的关系</p>
</blockquote>
<ul>
<li>
<p>开始安装，全文无图。</p>
<ul>
<li>
<p>预准备工作</p>
<ul>
<li>下载<a href="https://developer.nvidia.com/cuda-toolkit-archive" target="_blank" rel="noopener">CUDA10.0</a></li>
<li>下载<a href="https://developer.nvidia.com/rdp/cudnn-archive" target="_blank" rel="noopener">cuDNN7.5 for CUDA10.0</a>，需要注册后下载，支持微信和QQ</li>
<li>下载<a href="https://www.anaconda.com/distribution/" target="_blank" rel="noopener">Anaconda</a>，直接从官网下载会很慢，推荐将下载链接复制到百度云离线下载中，保存到百度云在进行下载速度快很多。或者直接下载百度云分享：链接：<a href="https://pan.baidu.com/s/1BKtXWtUVFl4isthLj4LLPg%E6%8F%90%E5%8F%96%E7%A0%81%EF%BC%9Assjs" target="_blank" rel="noopener">https://pan.baidu.com/s/1BKtXWtUVFl4isthLj4LLPg提取码：ssjs</a></li>
<li>在cmd中cmd中使用nvidia-smi查看显卡驱动是否正确安装，不过一般没啥问题</li>
</ul>
</li>
<li>
<p>安装CUDA10.0</p>
<ul>
<li>
<p>双击exe文件，只需要设置下安装路径就行，记住安装路径选择之后，左右的安装路径请保持一致。</p>
</li>
<li>
<p>到了驱动安装选项中，不要勾选NVIDAI Experience那个选项，因为我们用不到。</p>
</li>
<li>
<p>最后会提示没有vs支持，这个需要安装visual studio，勾选选择需要就行，然后就是漫长的安装vs过程，安装过程中选择C++桌面安装就行，选择好安装路径，不要都堆在C盘。</p>
</li>
<li>
<p>直至安装完成</p>
</li>
<li>
<p>最后测试下cmd中输入nvcc -V，显示正确的信息则安装完成。</p>
</li>
</ul>
</li>
<li>
<p>安装cuDNN7.5</p>
<ul>
<li>解压下载的安装包，打开文件夹，将文件夹中的内容复制到CUDA的安装路径中，这里以D:/CUDAv10.0为例，复制到该文件夹下。</li>
</ul>
</li>
<li>
<p>添加环境变量</p>
<ul>
<li>右击此电脑-高级系统设置-环境变量-系统变量里面的path：里面可以看到CUDA_PATH和CUDA_PATH_V10已经存在，以安装CUDA的路径为D:\CUDAv10.0为例添加以下路径到到path中：
<ul>
<li>D:\CUDAv10.1\bin</li>
<li>D:\CUDAv10.1\include</li>
<li>D:\CUDAv10.1\lib\x64</li>
</ul>
</li>
</ul>
</li>
<li>
<p>安装Anaconda3</p>
<ul>
<li>安装过程中只需要设置下安装路径即可</li>
<li>添加环境变量，以安装路径为D:\Anaconda3为例，添加以下变量到Path
<ul>
<li>D:\Anaconda3</li>
<li>D:\Anaconda3\Scripts</li>
<li>D:\Anaconda3\Library\bin</li>
</ul>
</li>
<li>经过上面的步骤就可以在cmd中使用conda，pip，python</li>
</ul>
</li>
<li>
<p>安装tensorflow-gpu</p>
<ul>
<li>现在cmd中升级下pip配置下pip的源，第二部分的问题中有提到具体方法；</li>
<li>使用pip安装
<ul>
<li>pip install tensorflow-gpu==2.0.0-rc0</li>
<li>等待安装完成</li>
</ul>
</li>
<li>测试是安装成功，cmd下输入
<ul>
<li>&gt; python</li>
<li>&gt;&gt;import tensorflow as tf</li>
<li>&gt;&gt;tf.__versioin__</li>
<li>输出’2.0.0-rc0’</li>
</ul>
</li>
</ul>
</li>
<li>
<p>完成安装</p>
</li>
<li>
<p>在python中使用opencv</p>
<ul>
<li>第一步在电脑中下载编译opencv，在另一篇文章中写道<code>opencv安装与配置</code></li>
<li>以安装路径为D:\opencv4.1.2\opencv\build，找到D:\opencv4.1.2\opencv\build\python\cv2\python-3.7下的以pyd为后缀的文件，拷贝到python所在目录的Lib\site-packages文件夹下，有必要的话可以将D:\opencv4.1.2\opencv\build\python\cv2\python-3.7添加到环境变量中。</li>
<li>在python中测试：
<ul>
<li>import cv2 as cv</li>
<li>cv._<em>version</em>_</li>
<li>‘4.1.2’</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h1 id="tensorflow安装过程中遇到的问题与解决办法"><a class="markdownIt-Anchor" href="#tensorflow安装过程中遇到的问题与解决办法"></a> Tensorflow安装过程中遇到的问题与解决办法：</h1>
<ul>
<li>下载anaconda速度非常慢
<ul>
<li>将anaconda下载链接复制到百度云离线下载中，保存到百度云进行下载，速度虽然慢（还至少比官网快）但是稳定，当然迅雷应该也是可以；</li>
</ul>
</li>
<li>pip安装tensorflow速度很慢
<ul>
<li>更改pip的源改为清华的镜像源</li>
<li>pip install pip -U<br />
pip config set global.index-url <a href="https://pypi.tuna.tsinghua.edu.cn/simple" target="_blank" rel="noopener">https://pypi.tuna.tsinghua.edu.cn/simple</a></li>
<li>更改完以后下载库文件直接从这个镜像源下载，速度很快的。</li>
</ul>
</li>
<li>conda更换源
<ul>
<li>conda config --add channels <a href="https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/" target="_blank" rel="noopener">https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/</a></li>
<li>conda config --set show_channel_urls yes</li>
</ul>
</li>
</ul>
<p>参考：</p>
<ul>
<li><a href="https://blog.csdn.net/huanyingzhizai/article/details/89298964#%E5%AE%89%E8%A3%85tensorflow1.13(with-Anaconda)" target="_blank" rel="noopener">https://blog.csdn.net/huanyingzhizai/article/details/89298964#%E5%AE%89%E8%A3%85tensorflow1.13(with-Anaconda)</a></li>
<li><a href="https://blog.csdn.net/huanyingzhizai/article/details/100778893" target="_blank" rel="noopener">https://blog.csdn.net/huanyingzhizai/article/details/100778893</a></li>
<li><a href="https://blog.csdn.net/weixin_42267309/article/details/92800901" target="_blank" rel="noopener">https://blog.csdn.net/weixin_42267309/article/details/92800901</a></li>
<li><a href="https://blog.csdn.net/qq_43673118/article/details/90140395" target="_blank" rel="noopener">https://blog.csdn.net/qq_43673118/article/details/90140395</a></li>
<li><a href="https://blog.csdn.net/ITLearnHall/article/details/81708148" target="_blank" rel="noopener">https://blog.csdn.net/ITLearnHall/article/details/81708148</a></li>
<li><a href="https://blog.csdn.net/howlclat/article/details/78783701" target="_blank" rel="noopener">https://blog.csdn.net/howlclat/article/details/78783701</a></li>
</ul>

      </section>
      <section class="extra">
        
        <ul class="copyright">
  
  <li><strong>本文作者：</strong>Alex</li>
  <li><strong>本文链接：</strong><a href="https://cxpeng.cn/archives/bb4fe864.html">https://cxpeng.cn/archives/bb4fe864.html</a></li>
  <li><strong>版权声明：</strong>本博客所有文章均采用<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh"
      rel="external nofollow" target="_blank"> BY-NC-SA </a>许可协议，转载请注明出处！</li>
  
</ul>
        
        
        <section class="donate">
  <div class="qrcode">
    <img   class="lazyload" data-original="https://pic.izhaoo.com/alipay.jpg" src="" >
  </div>
  <div class="icon">
    <a href="javascript:;" target="_blank" rel="noopener" id="alipay"><i class="iconfont iconalipay"></i></a>
    <a href="javascript:;" target="_blank" rel="noopener" id="wechat"><i class="iconfont iconwechat-fill"></i></a>
  </div>
</section>
        
        
        
<nav class="nav">
  
    <a href="/archives/154a8569.html"><i class="iconfont iconleft"></i>2019年总结</a>
  
  
    <a href="/archives/b3404e24.html">换电脑之博客迁移.md<i class="iconfont iconright"></i></a>
  
</nav>

      </section>
      
      <section class="comments">
  
  <div class="btn" id="comments-btn">查看评论</div>
  
  
</section>
      
    </section>
  </div>
</article>
  </div>
</main>
  <footer class="footer">
  <div class="footer-social">
    
    
    
    
    
    <a href="tencent://message/?Menu=yes&uin=894519210 " target="_blank" onMouseOver="this.style.color= '#12B7F5'"
      onMouseOut="this.style.color='#33333D'">
      <i class="iconfont footer-social-item  iconQQ "></i>
    </a>
    
    
    
    
    
    <a href="javascript:; " target="_blank" onMouseOver="this.style.color= '#09BB07'"
      onMouseOut="this.style.color='#33333D'">
      <i class="iconfont footer-social-item  iconwechat-fill "></i>
    </a>
    
    
    
    
    
    <a href="https://www.instagram.com/izhaoo/ " target="_blank" onMouseOver="this.style.color= '#DA2E76'"
      onMouseOut="this.style.color='#33333D'">
      <i class="iconfont footer-social-item  iconinstagram "></i>
    </a>
    
    
    
    
    
    <a href="https://github.com/izhaoo " target="_blank" onMouseOver="this.style.color= '#24292E'"
      onMouseOut="this.style.color='#33333D'">
      <i class="iconfont footer-social-item  icongithub-fill "></i>
    </a>
    
    
    
    
    
    <a href="mailto:izhaoo@163.com " target="_blank" onMouseOver="this.style.color='#FFBE5B'"
      onMouseOut="this.style.color='#33333D'">
      <i class="iconfont footer-social-item  iconmail"></i>
    </a>
    
  </div>
  <div class="footer-copyright"><p>Powered by <a target="_blank" href="https://hexo.io">Hexo</a>  |  Theme - <a target="_blank" href="https://github.com/izhaoo/hexo-theme-zhaoo">zhaoo</a></p></div>
</footer>
  
      <div class="fab fab-plus">
    <i class="iconfont iconplus"></i>
  </div>
  
  <div class="fab fab-daovoice">
    <i class="iconfont iconcomment"></i>
  </div>
  
  <div class="fab fab-up">
    <i class="iconfont iconcaret-up"></i>
  </div>
  
<script type="text/x-mathjax-config">
    MathJax.Hub.Config({
        tex2jax: {
            inlineMath: [ ["$","$"], ["\\(","\\)"] ],
            skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code'],
            processEscapes: true
        }
    });
    MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax();
        for (var i = 0; i < all.length; ++i)
            all[i].SourceElement().parentNode.className += ' has-jax';
    });
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML"></script>
</body>

<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>




<script src="https://cdn.bootcdn.net/ajax/libs/jquery.lazyload/1.9.1/jquery.lazyload.min.js"></script>




<script src="https://cdn.bootcss.com/fancybox/3.5.7/jquery.fancybox.min.js"></script>




<script src="/js/utils.js"></script>
<script src="/js/modules.js"></script>
<script src="/js/zui.js"></script>
<script src="/js/script.js"></script>




<script>
  (function (i, s, o, g, r, a, m) {
    i["DaoVoiceObject"] = r;
    i[r] = i[r] || function () {
      (i[r].q = i[r].q || []).push(arguments)
    }, i[r].l = 1 * new Date();
    a = s.createElement(o), m = s.getElementsByTagName(o)[0];
    a.async = 1;
    a.src = g;
    a.charset = "utf-8";
    m.parentNode.insertBefore(a, m)
  })(window, document, "script", ('https:' == document.location.protocol ? 'https:' : 'http:') +
    "//widget.daovoice.io/widget/0f81ff2f.js", "daovoice")
  daovoice('init', {
    app_id: "abcdefg"
  }, {
    launcher: {
      disableLauncherIcon: true,
    },
  });
  daovoice('update');
</script>



<script>
  (function () {
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
      bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
    } else {
      bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
  })();
</script>


<script>
  var _hmt = _hmt || [];
  (function () {
    var hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?4c204d8bc027a0455b5fc642ac334ca8";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
  })();
</script>










</html>